<div ng-controller="z-salaryRequest-c" z-loading is-loading="viewModel.isLoading">
    <div viewstack class="carousel slide" data-ride="carousel">
        <div class="carousel-inner" role="listbox">
            <div class="item active">
                <div class="row">
                    <div class="col-lg-12 heading">
                        <ul id="crumb" class="breadcrumb">
                            <li>
                                <i class="im-home"></i>
                                <a href="index.html">首页</a>
                            </li>
                            <li ng-repeat="menu in viewModel.menuList">
                                <i class="{{menu.icons}}" ng-if="$index+1!=viewModel.menuList.length"></i>
                                <i class="en-arrow-right7" ng-if="$index+1==viewModel.menuList.length"></i>
                                {{menu.label}}
                            </li>
                        </ul>
                    </div>
                </div>

                <div class="outlet">
                    <div class="panel-body">
                        <form class="form-horizontal group-border hover-stripped" role="form" name="form">
                            <div class="row">
                                <!-- 检索条件 -->
                                <div class="col-xs-12 col-sm-10 col-md-11 form-box">
                                    <div class="col-sm-6 col-md-4 col-lg-4 form-item">
                                        <div class="col-sm-5 col-md-5 form-title">开始日期：
                                        </div>
                                        <div class="col-sm-7 col-md-7 form-input">
                                            <div class="input-group"
                                                 ng-class="{ 'has-error' : form.reportStratDate.$invalid && !form.reportStratDate.$pristine }">
                                                <input name="reportStratDate"
                                                       ng-model="viewModel.reportStratDate"
                                                       class="form-control datetime-picker"
                                                       type="text"
                                                       autofocus="autofocus"
                                                       maxLength="10"
                                                       ng-click="viewModel.startDateOpen($event)"
                                                       z-datepicker-popup="{{viewModel.format}}"
                                                       is-open="viewModel.startDateOpened"
                                                       datepicker-options="viewModel.dateOptions"
                                                       close-text="Close"
                                                       required
                                                       readonly
                                                       tabIndex="8">
                                                <span class="input-group-addon cursorPointer"
                                                      ng-click="viewModel.startDateOpen($event)"><i
                                                        class="fa-calendar"></i></span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-sm-6 col-md-4 col-lg-4 form-item">
                                        <div class="col-sm-5 col-md-5 form-title">结束日期：
                                        </div>
                                        <div class="col-sm-7 col-md-7 form-input">
                                            <div class="input-group"
                                                 ng-class="{ 'has-error' : form.reportEndDate.$invalid && !form.reportEndDate.$pristine }">
                                                <input name="reportEndDate"
                                                       ng-model="viewModel.reportEndDate"
                                                       class="form-control datetime-picker"
                                                       type="text"
                                                       autofocus="autofocus"
                                                       maxLength="10"
                                                       ng-click="viewModel.endDateOpen($event)"
                                                       z-datepicker-popup="{{viewModel.format}}"
                                                       is-open="viewModel.endDateOpened"
                                                       datepicker-options="viewModel.dateOptions"
                                                       close-text="Close"
                                                       required
                                                       readonly
                                                       tabIndex="9">
                                                <span class="input-group-addon cursorPointer"
                                                      ng-click="viewModel.endDateOpen($event)"><i
                                                        class="fa-calendar"></i></span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-sm-6 col-md-4 col-lg-3 form-item">
                                        <div class="col-sm-7 col-md-7 form-input-left">
                                            <button type="button" class="btn btn-success"
                                                    ng-click="viewModel.bindData()" tabIndex="10">搜索
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>

                <div class="outlet">
                    <div style="overflow-x: auto;">
                        <!-- col-lg-12 start here -->
                        <table class="table table-striped table-bordered" cellspacing="0"
                               style="width:100%;">
                            <thead class="submitHistory-tr-1">
                            <tr>
                                <th ng-show="viewModel.checkbox1" width="15%">申请日期</th>
                                <th ng-show="viewModel.checkbox2" width="15%">工资月份</th>
                                <th ng-show="viewModel.checkbox3" width="15%">审批状态</th>
                                <th ng-show="viewModel.checkbox4" width="20%">备注</th>
                                <th ng-show="viewModel.checkbox5" width="15%">明细</th>
                                <th ng-show="viewModel.checkbox6">操作</th>
                            </tr>
                            </thead>

                            <!--  与thead对应 待定-->
                            <tbody class="submit-scroll-body">
                            <tr ng-repeat="submitHistory in viewModel.dataList">
                                <td ng-show="viewModel.checkbox1">
                                    <div>{{submitHistory.requestDate | date:'yyyy/MM/dd HH:mm:ss'}}</div>
                                </td>
                                <td ng-show="viewModel.checkbox2">
                                    <div>{{submitHistory.salaryYear}}年{{submitHistory.salaryMonth}}月</div>
                                </td>
                                <td ng-show="viewModel.checkbox3">
                                    <a ng-click="viewModel.selectApprovalRecord(submitHistory)"
                                       ng-if="submitHistory.requestState!=0">{{submitHistory.approvalStateName}}</a>
                                    <span ng-if="submitHistory.requestState==0">{{submitHistory.approvalStateName}}</span>
                                </td>
                                <td ng-show="viewModel.checkbox4"><div>{{submitHistory.description}}</div></td>
                                <td ng-show="viewModel.checkbox5">
                                    <button class="btn btn-primary btn-sm" ng-click="viewModel.showDetail(submitHistory)">明细</button>
                                	<button class="btn btn-success btn-sm" ng-click="viewModel.download(submitHistory)">下载</button>
                                </td>
                                <td ng-show="viewModel.checkbox6">
                                    <div>
                                        <button type="button" class="btn btn-sm btn-warning"
                                                ng-show="submitHistory.requestState==1" ng-click="viewModel.withdraw(submitHistory)">撤回
                                        </button>
                                        <button type="button" class="btn btn-sm btn-warning"
                                                ng-show="submitHistory.requestState==0" ng-click="viewModel.saveSubmit(submitHistory)">提交
                                        </button>
                                        <button type="button" class="btn btn-danger btn-sm"
                                                ng-show="submitHistory.requestState==0" ng-click="viewModel.delete(submitHistory)">删除
                                        </button>
                                    </div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="row" style="padding-left: 15px;">
                        <div z-Pagination total-Data='viewModel.totalData'
                             per-Page='viewModel.perPage'
                             current-Page='viewModel.rowCount'
                             on-Click="viewModel.bindData()"
                             on-Change-Per-Page="viewModel.bindData()"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <z-Dialog show-Save-Btn="false" show-Submit-Btn="false"
              have-Error-Class="true"
              load-Url="static/html/salaryRequest/selectApprovalRecord.html"
              title="{{approvalRecord.title}}"
              show="approvalRecord.show"
              cancel-fn="viewModel.unLoad()"
              body-Height="465" style="overflow-y:scroll"></z-Dialog>

    <z-Dialog show-Save-Btn="false" show-Submit-Btn="false" id="full-salary"
              have-Error-Class="true"
              load-Url="static/html/salaryRequest/salaryDetail.html"
              title="{{detailModel.title}}"
              show="detailModel.show"
              cancel-fn="viewModel.unLoad()"
              body-Height="600" style="overflow-y:scroll"></z-Dialog>
</div>